import React from "react";
import { Provider } from "react-redux";
import { store } from "../store";
import { I18nextProvider } from "react-i18next";
import i18n from "../local";
import { useMount } from "ahooks";
import { KEYCONST } from "../enums";
import { jsx as _jsx } from "react/jsx-runtime";
var KingsWalletProvider = function(props) {
    var children = props.children;
    useMount(function() {
        try {
            var language = window.localStorage.getItem(KEYCONST.language) || "en";
            if (i18n.language == language) return;
            i18n.changeLanguage(language);
        } catch (e) {}
    });
    return /*#__PURE__*/ _jsx(Provider, {
        store: store,
        children: /*#__PURE__*/ _jsx(I18nextProvider, {
            i18n: i18n,
            children: children
        })
    });
};
export default KingsWalletProvider;

 //# sourceMappingURL=index.js.map